/*
 * @Description:
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-10-09 17:40:14
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-11-03 09:38:52
 * @FilePath: /nhw/src/utils/formateDate.js
 */

export default function (value) {
  const date = new Date(value);
  const year = date.getFullYear();

  let month = date.getMonth() + 1;
  if (month < 10) month = "0" + month;

  let day = date.getDate();
  if (day < 10) day = "0" + day;

  let hours = date.getHours();
  if (hours < 10) hours = "0" + hours;

  let minutes = date.getMinutes();
  if (minutes < 10) minutes = "0" + minutes;

  return `${year}-${month}-${day} ${hours}:${minutes}`;
}